import { defineStore } from 'pinia'
import { DepartmentAdd } from '../utils/trueType'
export const useAddDepartmentStore = defineStore('addDepartment', {
    state: () => ({
        department:
            {
                id: '',
                parentId: '',
                deptName: '',
                status: 1,
                time: null,
                managerId: '',
            } as DepartmentAdd,
        isOpen: false
    }),
    actions: {
        setIsOpen(boolean: boolean) {
            this.isOpen = boolean
        },
        setDepartment(department: DepartmentAdd) {
            this.department = department
        },
        setDepartmentNull(){
            this.department = {
                id: '',
                parentId: '',
                deptName: '',
                status: 1,
                time: null,
                managerId: '',
            } as DepartmentAdd
        }
    },
    getters: {

    },
}
)